import { createApp } from "vue";

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

import App from "./App.vue";

// 引入 windi.css
import "virtual:windi.css";
// 引入router与路由守卫
import { router } from "./router";
import "~/router/permission.js";
// 引入pinia
import { createPinia } from "pinia";
const store = createPinia();
// 引入进度条
import "nprogress/nprogress.css";
// 引入自定义指令
import auth from "~/directives/auth.js";

const app = createApp(App);

app.use(ElementPlus);
app.use(router);
app.use(store);
app.use(auth);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.mount("#app");
